package com.java.atm.Test;

import com.java.atm.Server.ATM;
import org.junit.jupiter.api.Test;

import java.net.Socket;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import static org.junit.jupiter.api.Assertions.*;

class ATMTest
{

    @Test
    void signUp()throws Exception
    {
        try
        {
            Class.forName("com.mysql.jdbc.Driver");
            String dbURL = "jdbc:mysql://localhost:3306/java?user=root&password=jazz";
            Connection connection = DriverManager.getConnection(dbURL);
            ATM atm = new ATM(new Socket(), connection);
            atm.SignUp();

        }catch(ClassNotFoundException e)
        {
            System.err.println("no driver!");
        }catch(SQLException e)
        {
            e.getErrorCode();
        }

    }

}